package removeElement;

public class removeElement {

	public static void main(String[] args) {
		
		int nums[] = {3,2,2,3};
		removeElement(nums,3);
		

	}
	public static void removeElement(int[] nums, int val) {
        int left = 0;
        int right = 1;
        int n = nums.length;
        while(right < n){
            if(nums[right] == val){
                nums[right] = nums[left];
                left++;
                right++;
            }
        }
        for(int o : nums) {
        	System.out.println(o);
        }
       
}

}
